package boss.portal.controller;

import boss.portal.common.ResponseData;
import cn.hutool.core.map.MapUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@Api(description = "首页数据", value = "首页数据")
@RestController
@RequestMapping("/home")
public class HomPageController extends BaseController{

    @PostMapping("/order/count")
    @ApiOperation(value = "订单统计数据接口",notes = "pending:待处理；remian:剩余发货；saleOrder：售后订单")
    public ResponseData orderCount(){
        Map<String,Long> orderMap = new HashMap<>();
        orderMap.put("pending",20L);
        orderMap.put("remain",6L);
        orderMap.put("saleOrder",2L);
        return success(orderMap);
    }

    @PostMapping("/order/pack")
    @ApiOperation(value = "代打包",notes = "waitCommit:待提交；commitFail：提交失败！")
    public ResponseData orderPack(){
        Map<String,Long> packMap = new HashMap<>();
        packMap.put("waitCommit",17L);
        packMap.put("commitFail",1L);
        return success(packMap);
    }

    @PostMapping("/translate")
    @ApiOperation(value = "翻译统计数据接口",notes = "today:今日翻译（key:数量、http://www.baidu.com（查看记录）；）；yesterday：昨日翻译")
    public ResponseData translate(){
        Map<String,Map<Long,String>> packMap = new HashMap<>();
        packMap.put("today", MapUtil.of(12L,"http://www.baidu.com"));
        packMap.put("yesterday",MapUtil.of(56L,"http://www.baidu.com"));
        return success(packMap);
    }
}
